package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

@Entity
@Table(name = "mall_fund")
@DynamicInsert
@DynamicUpdate
public class MallFund extends IDEntityMall {

    @Column(columnDefinition = "DECIMAL(30,10) comment '总金额'")
    private BigDecimal totalAmount = BigDecimal.ZERO;
    @Column(columnDefinition = "DECIMAL(30,10) comment '冻结金额'")
    private BigDecimal frozen = BigDecimal.ZERO;
    @Column(columnDefinition = "DECIMAL(30,10) comment '可用金额'")
    private BigDecimal availableAmount = BigDecimal.ZERO;

    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '可用现金券金额'")
    private BigDecimal availableCashAmount = BigDecimal.ZERO;

    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;
    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public BigDecimal getFrozen() {
        return frozen;
    }

    public void setFrozen(BigDecimal frozen) {
        this.frozen = frozen;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getAvailableAmount() {
        return availableAmount;
    }

    public void setAvailableAmount(BigDecimal availableAmount) {
        this.availableAmount = availableAmount;
    }

    public BigDecimal getAvailableCashAmount() {
        return availableCashAmount;
    }

    public void setAvailableCashAmount(BigDecimal availableCashAmount) {
        this.availableCashAmount = availableCashAmount;
    }

    @Override
    public String toString() {
        return "MallFund{" +
                "totalAmount=" + totalAmount +
                ", frozen=" + frozen +
                ", availableAmount=" + availableAmount +
                ", availableCashAmount=" + availableCashAmount +
                ", mallId=" + mallId +
                '}';
    }
}